﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>登录/注册</title>
    <script type="text/javascript" src="http://js.40017.cn/touch/cn/public/jquery-1.8.3.min.js"> </script>
    <style type="text/css">
        * {
            margin: 0;
            padding: 0;
        }

        #content {
            width: 300px;
            height: 200px;
            border: 1px solid #909090;
            margin: auto;
            margin-top: 200px;
            border-radius: 20px;
            -webkit-border-radius: 20px;
            -moz-border-radius: 20px;
            -webkit-box-shadow: #666 0px 0px 10px;
            -moz-box-shadow: #666 0px 0px 10px;
            box-shadow: #666 0px 0px 10px;
            background: #e6ded1;
            text-align: center;
            vertical-align: middle;
            padding: 50px 100px;
        }

        ul li {
            list-style: none;
        }

        #content ul li {
            margin: 20px 0;
        }

        .txtL {
            width: 230px;
            height: 25px;
            padding: 0 5px;
        }

        #deng {
            float: left;
            margin-left: 10px;
        }

        #zhu {
            float: right;
            margin-right: 10px;
        }

        #deng, #zhu {
            width: 80px;
            height: 30px;
            background: #e2ab3a;
            border: none;
            -webkit-box-shadow: #666 0px 0px 5px;
            -moz-box-shadow: #666 0px 0px 5px;
            box-shadow: #666 0px 0px 5px;
        }

            #deng:hover, #zhu:hover {
                cursor: pointer;
                -webkit-box-shadow: #666 0px 0px 0px;
                -moz-box-shadow: #666 0px 0px 0px;
                box-shadow: #666 0px 0px 0px;
            }
    </style>
    <script type="text/javascript">
        function Login(obj) {
            var name = $("#name").val();
            var pwd = $("#pwd").val();
            var reg = /\w+[@]{1}\w+[.]\w+/;
            if (!reg.test(name)) {
                alert("账号格式错误！"); return;
            }
            $.ajax({
                url: "AjaxHandler.ashx",
                data: { name: name, pwd: pwd, type: obj },
                type: "post",
                success: function (data) {
                    if (data.length > 0) { alert(data); }
                    else { window.location = "../Index.html"; }
                }
            });
        }
    </script>
</head>
<body>
    <div style="width: 100%;">
        <div id="content">
            <ul></ul>
            <ul>
                <li><span>账号：</span><input type="text" class="txtL" value="" id="name" placeholder="123@qq.com" /></li>
                <li><span>密码：</span><input type="password" class="txtL" value="" id="pwd" /></li>
                <li>
                    <input type="button" value="登录" onclick="Login(1)" id="deng" />
                    <input type="button" value="注册" onclick="Login(0)" id="zhu" />
                </li>
            </ul>
        </div>
    </div>
</body>
</html>
